import React from 'react';
import { Text, View } from 'react-native';
import NavBar from './navbar';
import { useNavigation } from '@react-navigation/native';
import SwiperNav from './swipernav';
import SeckillGoods from './seckillgoods';
import WaterFlowGoods from './waterflowgoods';

const HomeScreen = () => {
  const navigation = useNavigation();

  return (
    <View style={{ flex: 1 }}>
      <NavBar
        onMenuPress={() => console.log('菜单被点击')}
        onSearchChange={text => console.log('搜索输入:', text)}
        onLoginPress={() => navigation.navigate('Login' as never)}
        backgroundColor="#f44c45"
        fontColor="#ffffff"
      />
      <SwiperNav />
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
        <SeckillGoods />
        <WaterFlowGoods />
      </View>
    </View>
  );
};``

export default HomeScreen;
